package com.netjava.actions;

import javax.servlet.ServletContext;

import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;
import org.springframework.web.struts.ActionSupport;

public class BaseAction extends ActionSupport{
	protected Object getBean(String id){
		ServletContext sc=this.servlet.getServletContext();
		WebApplicationContext ctx=WebApplicationContextUtils
			.getWebApplicationContext(sc);
		return ctx.getBean(id);
	}
}
